
package com.zj.mes.sys.controller;

import com.zj.mes.common.controller.BaseController;
import com.zj.mes.common.entity.Resource;
import com.zj.mes.common.entity.ResultModel;
import com.zj.mes.sys.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Copyright (C), 2015-2019
 * FileName: PermissionController
 * Author:   王晓楠
 * Date:     2019/7/18 10:24
 * Description:
 */
@Controller
@RequestMapping("/per")
public class PermissionController extends BaseController {
    @Autowired
    private IPermissionService permissionService;
    /**
     * 跳转至权限管理网页
     * @return
     */
    @RequestMapping("/power")
    public String power(){
        return "permission";
    }
    /**
     * 获取所有权限
     */
    @RequestMapping("/getPower")
    @ResponseBody
    public ResultModel getPower(Integer status){
        return permissionService.getPower(status);
    }
    /**
     * 权限的启用与禁用
     */
    @RequestMapping("/updatePermissionStatus")
    @ResponseBody
    public ResultModel getPower(Integer id, Integer state){
        return permissionService.getPower(state);
    }
}
